package com.you.modules.websocket.socket;

import com.you.common.constant.Constant;
import com.you.common.util.ResponseUtil;
import com.you.modules.user.service.IUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

@Controller
public class WebSocketMapping {
    @Autowired
    private IUserInfoService userService;

    @MessageMapping("/hello")
    @SendTo(Constant.WebSocket.TOPIC_GREET)
    public Object changeNotice(String name) {
        return ResponseUtil.success("hi, "+name+"!");
    }
}
